package com.hu.jie.day01.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;
import android.support.v4.app.ListFragment;

import com.hu.jie.day01.contancs.UrlString;
import com.hu.jie.day01.fragment.LeftFragment;
import com.hu.jie.day01.fragment.TestFragment;

import java.util.ArrayList;
import java.util.List;

/**
 * ***********************************************************
 * author: jie
 * time: 2016/7/16 21:28
 * name:
 * overview:Build.VERSION.SDK_INT:版本号
 * usage:
 * *************************************************************
 */
public class MyAdapter extends FragmentPagerAdapter{
    private List<Fragment> mDatas = new ArrayList<>();

    private int COUNT = 2;
    public MyAdapter(FragmentManager fm) {
        super(fm);
        mDatas.add(LeftFragment.newIntance(UrlString.HOME_URL));
        mDatas.add(TestFragment.newTnstance(UrlString.COMMENT_URL));
    }

    @Override
    public Fragment getItem(int position) {
        return mDatas.get(position);
    }

    @Override
    public int getCount() {
        return COUNT;
    }

}
